<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
    	<div class="col-sm-12 search-collapse">
				<form id="user-form">
					<input type="hidden" id="deptId" name="deptId">
	                <input type="hidden" id="parentId" name="parentId">
					<div class="select-list">
						<ul>
							<li>
								病人姓名：<input type="text" name="Patient_Name"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
    	<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
			<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="module:blcx:edit">
	            <i class="fa fa-edit"></i> 查看
	        </a>
	        <a onclick="windowprint();" href="javascript:void(0);" style="border: 1px solid #1dc5a3;
    width: 60px;
    position: absolute;
    height: 30px;
    margin-left: 71px;
    margin-top: -30px;
    text-align: center;
    line-height: 28px;
    color: white;
    background: #1dc5a3;
    border-radius: 4px;">点击打印</a>
		</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div id="printdiv" th:include="include :: footer"></div>
    <script th:inline="javascript">
    	var editFlag = [[${@permission.hasPermi('module:blcx:edit')}]];
        var prefix = ctx + "module/blcx";

        $(function() {
            var options = {
                url: prefix + "/list",
                updateUrl: prefix + "/edit/{id}",
                modalName: "病例显示",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '',
					visible: false 
				},
				{
					field : 'Patient_Name', 
					title : '病人姓名' 
				},
				{
					field : 'patient_sex', 
					title : '性别' 
				},
				{
					field : 'patient_age', 
					title : '年龄' 
				},
				{
					field : 'patient_phone', 
					title : '手机号' 
				},
				{
					field : 'patient_card', 
					title : '身份证号' 
				},
				{
					field : 'patient_Icd', 
					title : '疾病名称' 
				},
				{
					field : 'patient_sfcrb', 
					title : '是否传染病' 
				},
				{
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        
      //直接在本窗口进行打印
        function windowprint() {
            var f = document.getElementById("bootstrap-table");
            window.print();
        }
         
        //新开一个窗口实现打印
        function myPrint(obj){
         
            var newWindow=window.open("打印窗口","_blank");
            var docStr = obj.innerHTML;
               newWindow.document.write(docStr);
            newWindow.document.close();
            newWindow.print();
            newWindow.close();
        }
        
    </script>
</body>
</html>